//
//  TSPageTableView.m
//  chart
//
//  Created by xu on 15/8/15.
//  Copyright (c) 2015年 xu. All rights reserved.
//

#import "TSPageTableView.h"

@implementation TSPageTableView

- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style{
    if (self=[super initWithFrame:frame style:style]) {
        self.dataSource = self;
        self.delegate = self;
        
        self.pageIndex = PAGE_TB_PAGE_INDEX;
        self.pageSize  = PAGE_TB_PAGE_SIZE;
        
        WS(weakSelf);
        MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
            [weakSelf headerRequestData];
        }];
        header.lastUpdatedTimeLabel.hidden = YES;
        self.header = header;
        
        MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
            [weakSelf footerRequestData];
        }];
        footer.stateLabel.hidden = YES;
        footer.refreshingTitleHidden = YES;
        self.footer = footer;
    }
    
    return self;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return nil;
}

- (void)headerRequestData
{
    NSLog(@"### TSPageTableView headerRequestData");
}

- (void)footerRequestData
{
    NSLog(@"### TSPageTableView footerRequestData");
}

@end
